<template>
  <view>
    <up-row
      type="flex"
      align="center"
      justify="space-between"
      :customStyle="{ height: 'calc(100vh - 45px)', 'flex-direction': 'column' }"
    >
      <up-row align="center" :customStyle="{ 'margin-top': '10vh', 'flex-direction': 'column' }">
        <uni-icons
          custom-prefix="iconfont"
          type="icon-roundcheckfill"
          size="68"
          :color="$u.color.success"
        ></uni-icons>
        <view class="u-main-color u-m-t-20 txt-large">支付成功</view>
        <view class="u-tips-color u-m-t-10 txt-small">感谢您的信任与支持,您的商品我们将马上打包好</view>
        <view class="u-tips-color u-m-t-10 txt-small">期待送达到您手中!</view>
      </up-row>

      <up-row style="margin-bottom: 10vh;" v-if="fromType != 'recharge'">
        <view>
          <up-button type="info" size="normal" @click="toOrder">查看订单</up-button>
        </view>
        <view class="u-m-l-80">
          <up-button type="info" size="normal" @click="toIndex">返回首页</up-button>
        </view>
      </up-row>
    </up-row>
  </view>
</template>

<script>
export default {
  data() {
    return {
      tradeId: '',
      fromType: '',
    }
  },
  methods: {
    toIndex() {
      uni.reLaunch({
        url: '/pages/index/index'
      })
    },
    toOrder() {
      uni.redirectTo({ url: '/pages/create-order/create-order?id=' + this.tradeId + '&type=info'})
    }
  },
  onLoad(options) {
    this.tradeId = options.id
    this.fromType = options.type
  }
}
</script>

<style lang="scss" scoped>

</style>